home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / GameboyDev / GBDK / include / font.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-29  |  1.3 KB  |  55 lines

  1. /* font.h
  2.     Multiple font support for the GameBoy
  3.     Michael Hope, 1999
  4.     michaelh@earthling.net
  5.     Distrubuted under the Artistic License - see www.opensource.org
  6. */
  7. #ifndef __FONT_H
  8. #define __FONT_H
  9.  
  10. #include <gb.h>
  11.  
  12. #define    FONT_256ENCODING    0
  13. #define    FONT_128ENCODING    1
  14. #define    FONT_NOENCODING        2
  15.  
  16. #define    FONT_COMPRESSED        4
  17.  
  18. /* See gb.h/M_NO_SCROLL and gb.h/M_NO_INTERP */
  19.  
  20. /* font_t is a handle to a font loaded by font_load() */
  21. typedef UWORD font_t;
  22.  
  23. /* The default fonts */
  24. extern UBYTE font_spect[], font_italic[], font_ibm[], font_min[];
  25.  
  26. /* Backwards compatible font */
  27. extern UBYTE fontibm_fixed[];
  28.  
  29. /* Init the font system */
  30. void    font_init(void);
  31.  
  32. /* Load the font 'font' */
  33. font_t    font_load( void *font );
  34.  
  35. /* Set the current font to 'font_handle', which was returned from an earlier
  36.    font_load().  Returns the previously used font handle.
  37. */
  38. font_t    font_set( font_t font_handle );
  39.  
  40. /* Print the same character 'show' 'num' times */
  41. void print_repeat(char show, UBYTE num);
  42.  
  43. /* Use mode() and color() to set the font modes and colours */
  44.  
  45. /* Internal representation of a font.  What a font_t really is */
  46. typedef struct sfont_handle mfont_handle;
  47. typedef struct sfont_handle *pmfont_handle;
  48.  
  49. struct sfont_handle {
  50.     UBYTE first_tile;        /* First tile used */
  51.     void *font;            /* Pointer to the base of the font */
  52. };
  53.     
  54. #endif /* __FONT_H */
  55.